const utils = {
    readCookie: (name)=>{
        var cookies = document.cookie.split('; ');
        for(var i = 0; i < cookies.length; i++) {
            var parts = cookies[i].split('=');
            if(name===parts[0]){
                return parts[1];
            }
        }
        return '';
    },
    ts2DateStr: (ts,format1)=>{
        if(!format1) format1 = 'YYYY-MM-DD HH:mm:ss'
        console.log(format1)
        return moment(parseInt(ts)).format(format1);
    }
}